<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>undefined和null</title>
</head>

<body>
    <script>
        //undefined这个值表示变量不含有值。
        //可以通过将变量的值设置为 null 来清空变量。
        var person;
        var car = "Volvo";
        document.write(person + "<br />");  //undefined
        document.write(car + "<br />"); //Volvo
        var car = null;
        document.write(car + "<br />"); //null
    </script>
</body>

</html>